﻿namespace dPet.Infrastructure.EntityFramework.Bootstrapper
{
	using dPet.Domain.Repositories;
	using dPet.Infrastructure.EntityFramework.Repositories;
	using Hangerd.Bootstrapper;
	using Hangerd.Extensions;
	using Hangerd.Repository;
	using Microsoft.Practices.Unity;

	public class RegisterServiceTask : RegisterServiceBootstrapperTask
	{
		public RegisterServiceTask(IUnityContainer container) : base(container) { }

		public override void Execute()
		{
			//unit of work
			_container.RegisterTypeAsPerRequest<IRepositoryContext, DPetUnitOfWork>();

			//repositories
			_container.RegisterTypeAsPerRequest<IHospitalRepository, HospitalRepository>();
			_container.RegisterTypeAsPerRequest<IStaffRepository, StaffRepository>();
			_container.RegisterTypeAsPerRequest<IStaffRoleRepository, StaffRoleRepository>();
			_container.RegisterTypeAsPerRequest<IProductCategoryRepository, ProductCategoryRepository>();
			_container.RegisterTypeAsPerRequest<IProductSubCategoryRepository, ProductSubCategoryRepository>();
			_container.RegisterTypeAsPerRequest<IProductRepository, ProductRepository>();
			_container.RegisterTypeAsPerRequest<IInventoryBatchRepository, InventoryBatchRepository>();
			_container.RegisterTypeAsPerRequest<ISaleOrderRepository, SaleOrderRepository>();
			_container.RegisterTypeAsPerRequest<IBillTemplateRepository, BillTemplateRepository>();
			_container.RegisterTypeAsPerRequest<IInventoryReducingRecordRepository, InventoryReducingRecordRepository>();
			_container.RegisterTypeAsPerRequest<IInventoryLORecordRepository, InventoryLORecordRepository>();
			_container.RegisterTypeAsPerRequest<IInventoryAlarmItemRepository, InventoryAlarmItemRepository>();
			_container.RegisterTypeAsPerRequest<IServiceCategoryRepository, ServiceCategoryRepository>();
			_container.RegisterTypeAsPerRequest<IServiceItemRepository, ServiceItemRepository>();
			_container.RegisterTypeAsPerRequest<IServiceItemSKURepository, ServiceItemSKURepository>();
			_container.RegisterTypeAsPerRequest<IServiceSKUPropertyRepository, ServiceSKUPropertyRepository>();
			_container.RegisterTypeAsPerRequest<IServiceOrderRepository, ServiceOrderRepository>();
		}
	}
}
